< previous page page_316 next page >

Page 316
The bottom line is, for your control to work, it must be properly installed. You can install in two ways, depending on the control's intended use:
Standard installation. If your custom ActiveX control is part of another VB project, it is installed and registered on the user's machine when the application files are installed.
Internet installation. If your control is part of a Web page, you must place the correct <OBJECT> tag in the HTML code. The OCX and supporting files, which must placed in CAB files on the Web server, are downloaded and installed by Internet Explorer.
Installing Your Control in a Setup Program
A standard installation is the easiest way to install your control on a PC. In a typical Standard EXE installation, a user runs a SETUP.EXE program, which installs and registers all the appropriate files. When you create the installation files for your Standard EXE project, use the Package and Deployment Wizard. The Wizard knows to include your OCX. However, if you think your OCX requires some support files that your application does not, you need to create a Dependency File by using the wizard. Using the Packaging and Deployment Wizard is described in detail in Appendix B, "Packaging Your Applications."
sarrow.gifSee "Packaging ActiveX Components," p. 788
Installing Your Control over the Internet
As you already know, for your ActiveX control to work on any given PC, the OCX file and other supporting files must be installed. If you intend to use your ActiveX control in a Web page, Microsoft Internet Explorer can automatically download and install the ActiveX control. However, deploying an ActiveX control in this manner is different from the traditional, interactive setup method. When a user accesses a Web page containing an ActiveX control, Internet Explorer downloads the required CAB (cabinet) files from the Web server and then installs the ActiveX components. This is one of the advantages of using Internet Explorer; you can quickly publish your latest ActiveX controls from a central Web server. However, for this process to work, you must provide all the necessary information to Internet Explorer.
First, you need to create CAB files for your ActiveX control. A CAB file is a special type of file that contains one or more compressed files; for example, a single CAB file might contain your compiled OCX and some Visual Basic runtime DLL files. The files contained within a CAB cannot be used until they are extracted to their original size on the client machine. You can create a CAB file with the Package and Deployment Wizard, as discussed in Appendix B, "Packaging Your Applications." However, occasionally you may need to work with a CAB file manually. The Internet Client SDK, available on Microsoft's Web site, provides some tools that you can use to manipulate CAB files from the command prompt.
Another (optional) step is to sign your CAB files digitally. You can buy a digital signature file, which verifies your identity to someone downloading your control. This file is intended as a security feature because an ActiveX control has full access to the machine on which it runs. If you do not sign your CAB files, an Internet Explorer user who wants to use your control has to lower the security settings in Internet Explorer to allow unsigned controls to execute on his or her PC.

 
< previous page page_316 next page >